package com.nbsaas.boot.finance.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "账户", model = "账户")
@Entity
@Table(name = "bs_cash_account")
@Comment("现金/银行账户表")
public class CashAccount extends AbstractEntity {

    @Comment("账户名称")
    @SearchItem(name = "name", key = "name", label = "账户名称")
    @FormField(title = "账户名称", sortNum = "1", grid = true, required = true)
    @Column(length = 100, nullable = false)
    private String name;

    @Comment("账户类型")
    @FormField(title = "账户类型", sortNum = "2", grid = true, type = InputType.select)
    @Column(length = 20)
    private String type;

    @Comment("账号")
    @FormField(title = "账号", sortNum = "3", grid = true)
    @Column(length = 50)
    private String accountNo;

    @Comment("余额")
    @FormField(title = "余额", sortNum = "4", grid = true, type = InputType.el_input_number)
    private BigDecimal balance;

    @Comment("开户行")
    @FormField(title = "开户行", sortNum = "5", grid = true)
    @Column(length = 100)
    private String bankName;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "6", type = InputType.textarea)
    private String remark;
} 